import pandas as pd
import numpy as np
s=pd.Series([1,3,6,np.nan,44,1])
print(s)
print("---------------------")
dates=pd.date_range("20160101",periods=6)
print(dates)
print("--------------------")
df=pd.DataFrame(np.random.randn(6,4),index=dates,columns=["a","b","c","d"])
#生成一个型状为（6,4）的二维数组，数组中的元素是标准正态分布（均值为0,标准差为1）
print(df)
df1=pd.DataFrame(np.arange(12).reshape((3,4)))
print(df1)
print("---------------------")
df2=pd.DataFrame({
"A":1,
"B":pd.Timestamp("20130102"),
"C":pd.Series(1,index=list(range(4)),dtype="float32"),
"D":np.array([3]*4,dtype="int32"),
"E":pd.Categorical(["test","train","test","train"]),
"F":"foo"})
print(df2)
print(df2.dtypes)
print("------------------")
print(df2.index)
print("------------------")
print(df2.columns)
print("------------------")
print(df2.values)
print("------------------")
print(df2.T)
print("------------------")
print(df2.sort_index(axis=1,ascending=False))#True是升序
print("------------------")
print(df2.sort_index(axis=0,ascending=False))
print("------------------")
print(df2.sort_values(by="E"))
print("------------------")
print(df2.describe())

